#define _CRT_SECURE_NO_WARNINGS 1
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define endl '\n'

int main() {
	ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	double a, b, c, d, e, x, y;
	cin >> a >> b >> c >> d >> e >> x >> y;
	double s1 = a * x + b * y;
	double s2 = c * y;
	double s3 = d * y + e;
	double mx = max({ s1,s2,s3 });
	if (s1 == mx) {
		cout << 1 << " " << fixed << setprecision(2) << mx << endl;
	}else if (s2 == mx) {
		cout << 2 << " " << fixed << setprecision(2) << mx << endl;
	}else {
		cout << 3 << " " << fixed << setprecision(2) << mx << endl;
	}
	return 0;
}